{volist name="$users_para" id="vo"}
    {switch name="vo.dtype"}
        {case value="text|email|mobile"}
        <div class="order-list">
            <div class="list-left">{$vo.title}</div>
            <div class="list-right">
                <div class="ey-input">
                    <div class="ey-input-wrapper">
                        <input type="text" class="ey-input-input" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
                    </div>
                </div>
            </div>
        </div>
        {/case}
        {case value="select"}
        <div class="order-list">
            <div class="list-left">{$vo.title}</div>
            <div class="list-right">
                <div class="select">
                    <select name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}">
                        <option value="">请选择</option>
                        {volist name="$vo.dfvalue" id="v2"}
                        <option value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}selected{/if}>{$v2}</option>
                        {/volist}
                    </select>
                </div>
                <i class="iconfont icon-right"></i>
            </div>
        </div>
        {/case}
        {case value="multitext"}
        <div class="order-list">
            <div class="list-left">{$vo.title}</div>
            <div class="list-right">
                <div class="ey-input">
                    <div class="ey-input-wrapper">
                        <textarea rows="5" cols="60" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" style="height:19px;">{$vo.dfvalue|default=''}</textarea>
                    </div>
                </div>
            </div>
        </div>
        {/case}
        {case value="radio"}
        <div class="order-list">
            <div class="list-left">{$vo.title}</div>
            <div class="list-right">
                <div class="ey-input">
                    {volist name="$vo.dfvalue" id="v2"}
                    <label class="input-radio">
                        <input type="radio" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}checked="checked"{/if}>&nbsp;{$v2}
                    </label>
                    {/volist}
                </div>
            </div>
        </div>
        {/case}
        {case value="checkbox"}
        <div class="order-list">
            <div class="list-left">{$vo.title}</div>
            <div class="list-right">
                <div class="ey-input">
                    {volist name="$vo.dfvalue" id="v2"}
                    <label class="input-checkbox">
                        <input type="checkbox" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}checked="checked"{/if}>&nbsp;{$v2}
                    </label>
                    {/volist}
                </div>
            </div>
        </div>
        {/case}
        {case value="datetime"}
        <div class="order-list">
            <div class="list-left">{$vo.title}</div>
            <div class="list-right">
                <div class="ey-input">
                    <div class="ey-input-wrapper">
                        <input type="text" class="ey-input-input" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="datetime_{$vo.fieldArr}_{$vo.name|default=''}" value="{php}if(empty($vo['dfvalue'])){echo date('Y-m-d H:i:s');}else{echo $vo['dfvalue'];}{/php}">
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            layui.use('laydate', function() {
                var laydate = layui.laydate;
                laydate.render({elem: "#datetime_{$vo.fieldArr}_{$vo.name|default=''}", type: 'datetime'});
            })
        </script>
        {/case}
        {case value="file"}
        <div class="order-list">
            <div class="list-left">{$vo.title}</div>
            <div class="list-right">
                <div class="ey-input">
                    <a id="download_file_{$vo.fieldArr}_{$vo.name|default=''}" style="margin-right: 30px; text-decoration: underline;" href="{$vo.info|default=''}" download="{$vo.info|get_filename=###}" class="{empty name='$vo.info' /}none{/empty}"><img src="__STATIC__/common/images/file.png" style="width: 16px; height:  16px;">下载附件</a>
                    <button type="button" class="users-btn users-btn-text" onclick="$('#onclick_{$vo.fieldArr}_{$vo.name|default=''}').trigger('click');"><span>上传文件</span></button>
                    <input type="file" id="onclick_{$vo.fieldArr}_{$vo.name|default=''}" onchange="upload_{$vo.fieldArr}_{$vo.name|default=''}(this);" style="display: none;">
                    <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="file_{$vo.fieldArr}_{$vo.name|default=''}" value="{$vo.info|default=''}">
                </div>
            </div>
        </div>
        <script type="text/javascript">
            // 图片附件
            function upload_{$vo.fieldArr}_{$vo.name|default=''}(obj) {
                var file = $(obj)[0].files[0];
                if (!file) return false;
                var formData = new FormData();
                formData.append('_ajax', 1);
                formData.append('file', file);
                formData.append('weappAjax', 1);
                layerLoading('正在上传');
                $.ajax({
                    type: 'post',
                    url : "{:url('Ueditor/DownloadUploadFileAjax')}",
                    data: formData,
                    dataType: 'json',
                    contentType: false,
                    processData: false,
                    success: function (res) {
                        layer.closeAll();
                        var imgField = "{$vo.fieldArr}_{$vo.name|default=''}";
                        if (1 === parseInt(res.code)) {
                            var arr = res.file_url.split("/");
                            var download = arr[arr.length-1];
                            $("#file_" + imgField).val(res.file_url);
                            $("#download_file_" + imgField)
                                .show()
                                .attr('href', res.file_url)
                                .attr('download', download)
                                .css('color', '#000')
                                .html('<img src="__STATIC__/common/images/file.png" alt="" style="width: 16px;height:  16px;">下载附件');
                        } else {
                            $("#download_file_" + imgField)
                                .show()
                                .css('color', 'red')
                                .text(res.msg)
                                .attr('href', 'javascript:void(0);');
                        }
                    },
                    error: function(e) {
                        layer.closeAll();
                        layerAlert(e.responseText);
                    }
                })
            }
        </script>
        {/case}
        {case value="img"}
        <div class="order-list">
            <div class="list-left">{$vo.title}</div>
            <div class="list-right">
                <div class="item-flex-img">
                    <a href="javascript:void(0);" id="a_{$vo.fieldArr}_{$vo.name|default=''}" onclick="$('#onclick_{$vo.fieldArr}_{$vo.name|default=''}').trigger('click');" class="img-upload mb15" title="点击上传">
                        <div class="y-line" {notempty name="$vo.dfvalue"} style="display: none;" {/notempty}></div>
                        <div class="x-line" {notempty name="$vo.dfvalue"} style="display: none;" {/notempty}></div>
                        <img src="{$vo.dfvalue}" {empty name="$vo.dfvalue"} style="display: none;" {/empty}>
                    </a>
                    <input type="file" id="onclick_{$vo.fieldArr}_{$vo.name|default=''}" onchange="upload_{$vo.fieldArr}_{$vo.name|default=''}(this);" style="display: none;">
                    <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="img_{$vo.fieldArr}_{$vo.name|default=''}" value="{$vo.dfvalue|default=''}">
                </div>
            </div>
        </div>
        <script type="text/javascript">
            // 图片上传
            function upload_{$vo.fieldArr}_{$vo.name|default=''}(obj) {
                var file = $(obj)[0].files[0];
                if (!file) return false;
                var formData = new FormData();
                formData.append('_ajax', 1);
                formData.append('file', file);
                formData.append('weappAjax', 1);
                formData.append('compress', '1000-1000');
                layerLoading('正在上传');
                $.ajax({
                    type: 'post',
                    url : "{:url('Ueditor/imageUp')}",
                    data: formData,
                    dataType: 'json',
                    contentType: false,
                    processData: false,
                    success: function (res) {
                        layer.closeAll();
                        var imgField = "{$vo.fieldArr}_{$vo.name|default=''}";
                        if (res.state == 'SUCCESS') {
                            $('#img_' + imgField).val(res.url);
                            $('#a_' + imgField).find('div').hide();
                            $('#a_' + imgField).find('img').show().attr('src', res.url);
                            layerMsg('上传成功');
                        } else {
                            $('#img_' + imgField).val('');
                            $('#a_' + imgField).find('div').show();
                            $('#a_' + imgField).find('img').hide();
                            layerAlert(res.state);
                        }
                    },
                    error : function(e) {
                        layer.closeAll();
                        layerAlert(e.responseText);
                    }
                })
            }
        </script>
        {/case}
        {case value="imgs"}
        <div class="order-list">
            <div class="list-left">{$vo.title}</div>
            <div class="list-right inline-block">
                <div class="tab-pane">
                    {volist name="$vo[$vo['name'].'_eyou_imgupload_list']" id="imgsVo"}
                    <div class="images_upload">
                        <div class="images_upload_item">
                            <input type="hidden" name="imgupload[]" value="{$imgsVo}">
                            <a class="img-upload" href="{$imgsVo}" target="_blank"><img src="{$imgsVo}"></a>
                            <a href="javascript:void(0)" onclick="clear_{$vo.fieldArr}_{$vo.name|default=''}(this, '{$imgsVo}')" class="delect"></a>
                        </div>
                    </div>
                    {/volist}
                    <div class="images_upload_main" id="imgs_{$vo.fieldArr}_{$vo.name|default=''}">
                        <a href="javascript:void(0);" onclick="$('#onclick_{$vo.fieldArr}_{$vo.name|default=''}').trigger('click');" class="img-upload mb15" title="点击上传">
                            <div class="y-line"></div>
                            <div class="x-line"></div>
                        </a>
                        <input type="file" multiple id="onclick_{$vo.fieldArr}_{$vo.name|default=''}" onchange="upload_{$vo.fieldArr}_{$vo.name|default=''}(this);" style="display: none;">
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            // 图片上传
            function upload_{$vo.fieldArr}_{$vo.name|default=''}(obj) {
                var file = $(obj)[0].files;
                var uploadLength = 0;
                var fileLength = file.length;
                var imgField = "{$vo.fieldArr}_{$vo.name|default=''}";
                layerLoading('正在上传');
                for (var i = 0; i < file.length; i++) {
                    if (file[i]) {
                        var formData = new FormData();
                        formData.append('_ajax', 1);
                        formData.append('weappAjax', 1);
                        formData.append('compress', '1000-1000');
                        formData.append('file', file[i]);
                        $.ajax({
                            type: 'post',
                            url : "{:url('Ueditor/imageUp')}",
                            data: formData,
                            dataType: 'json',
                            contentType: false,
                            processData: false,
                            success: function (res) {
                                if (res.state == 'SUCCESS') {
                                    // 加载图片
                                    var picHtml = 
                                        '<div class="images_upload">'+
                                            '<div class="images_upload_item">'+
                                                '<input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="' + res.url + '" />'+
                                                '<a class="img-upload" href="' + res.url + '" target="_blank"><img src="' + res.url + '"/></a>'+
                                                '<a  class="delect" href="javascript:void(0);" onclick="clear_'+imgField+'(this, \'' + res.url + '\')"></a>'+
                                            '</div>'+
                                        '</div>';
                                    $("#imgs_"+imgField).before(picHtml);
                                    // 如果是最后一张则关闭加载提示
                                    uploadLength++;
                                    if (parseInt(fileLength) === parseInt(uploadLength)) {
                                        layer.closeAll();
                                    }
                                } else {
                                    layerAlert(res.state);
                                }
                            },
                            error : function(e) {
                                layer.closeAll();
                                layerAlert(e.responseText);
                            }
                        })
                    }
                }
            }

            // 图片删除
            function clear_{$vo.fieldArr}_{$vo.name|default=''}(obj, path) {
                $.ajax({
                    type: 'GET',
                    url : "{:url('Uploadimgnew/delupload', ['_ajax' => 1, 'weappAjax' => 1])}",
                    data: {action: "del", filename: path},
                    success:function() {
                        $(obj).parent().parent().remove();   
                    }
                });
            }
        </script>
        {/case}
    {/switch}
{/volist}